/* 全局样式 - 改进版本 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 自定义CSS变量，便于主题管理 - 增强版本 */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --secondary-gradient: linear-gradient(45deg, #667eea, #764ba2, #f093fb);
    --accent-gradient: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    --success-color: #4caf50;
    --error-color: #ff5252;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #95a5a6;
    --background-white: rgba(255, 255, 255, 0.95);
    --background-glass: rgba(255, 255, 255, 0.1);
    --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 12px 35px rgba(0, 0, 0, 0.15);
    --border-radius: 20px;
    --border-radius-small: 12px;
    --border-radius-large: 30px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --blur: blur(15px);
    --backdrop-blur: blur(20px);
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    background: var(--primary-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    /* 添加动态背景效果 */
    position: relative;
    overflow-x: hidden;
}

/* 动态背景粒子效果 - 增强版本 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.15) 2px, transparent 2px),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px),
        radial-gradient(circle at 60% 30%, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
    background-size: 60px 60px, 90px 90px, 120px 120px, 150px 150px;
    animation: particleMove 25s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* 额外的光晕效果 */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.03) 0%, transparent 70%);
    animation: rotate 60s linear infinite;
    pointer-events: none;
    z-index: -2;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes particleMove {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    25% {
        transform: translate(40px, -25px) rotate(90deg) scale(1.1);
        opacity: 0.8;
    }
    50% {
        transform: translate(30px, 40px) rotate(180deg) scale(0.9);
        opacity: 1;
    }
    75% {
        transform: translate(-30px, 20px) rotate(270deg) scale(1.05);
        opacity: 0.9;
    }
}

/* 主容器样式 - 改进版本 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* 头部样式 - 增强版本 */
.header {
    background: var(--background-white);
    border-radius: var(--border-radius);
    padding: 25px 30px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-light);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

/* 头部光晕效果 */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: headerShine 3s ease-in-out infinite;
}

@keyframes headerShine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Logo样式改进 */
.logo h1 {
    background: var(--secondary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.2rem;
    font-weight: 700;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.5px;
}

.user-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-info input {
    padding: 12px 18px;
    border: 2px solid rgba(224, 224, 224, 0.5);
    border-radius: 30px;
    outline: none;
    font-size: 14px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 200px;
}

.user-info input:focus {
    border-color: #667eea;
    box-shadow:
        0 0 0 3px rgba(102, 126, 234, 0.1),
        0 4px 15px rgba(102, 126, 234, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    outline: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    position: relative;
    z-index: 1;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 8px 25px rgba(102, 126, 234, 0.4),
        0 4px 15px rgba(118, 75, 162, 0.3);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: rgba(245, 245, 245, 0.9);
    color: #555;
    border: 2px solid rgba(224, 224, 224, 0.5);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(233, 233, 233, 0.95);
    border-color: rgba(208, 208, 208, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-voice {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    font-size: 18px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.btn-voice::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.btn-voice:hover {
    background: linear-gradient(135deg, #ff5252 0%, #f44336 100%);
    transform: scale(1.15);
    box-shadow:
        0 6px 20px rgba(255, 107, 107, 0.4),
        0 0 0 10px rgba(255, 107, 107, 0.1);
}

.btn-voice:hover::before {
    width: 100%;
    height: 100%;
}

.btn-voice:active {
    transform: scale(1.05);
}

.btn-game {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 50%, #36d1dc 100%);
    color: white;
    margin: 8px;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.btn-game:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 8px 25px rgba(78, 205, 196, 0.4),
        0 4px 15px rgba(68, 160, 141, 0.3);
    filter: brightness(1.1);
}

/* 主内容区 */
.main-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* 角色选择区 - 增强样式 */
.character-selection h2 {
    text-align: center;
    margin-bottom: 40px;
    background: var(--secondary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* 角色控制区域 */
.character-controls {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 搜索框增强 */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* 筛选器样式 */
.character-filters {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.filter-buttons,
.personality-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 筛选按钮样式 */
.filter-btn,
.personality-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-btn:hover,
.personality-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--secondary-gradient);
    color: white;
    border-color: transparent;
}

.personality-btn.active {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    border-color: transparent;
}

/* 角色统计信息 */
.character-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-radius: var(--border-radius);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.stat-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--secondary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

/* 角色网格样式增强 */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 30px;
    padding: 10px;
}

/* 角色卡片样式大幅改进 */
.character-card {
    background: linear-gradient(145deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(248, 249, 255, 0.9) 50%,
        rgba(240, 244, 255, 0.95) 100%);
    border-radius: var(--border-radius);
    padding: 32px 28px;
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
    backdrop-filter: var(--backdrop-blur);
}

/* 卡片光晕效果 */
.character-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(102, 126, 234, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: var(--transition-slow);
    opacity: 0;
}

.character-card:hover::before {
    opacity: 1;
    transform: rotate(45deg) translate(20px, 20px);
}

/* 卡片悬停效果大幅增强 */
.character-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(102, 126, 234, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

/* 卡片激活状态 */
.character-card.active {
    border-color: #667eea;
    background: linear-gradient(145deg, #f0f4ff 0%, #e8f2ff 100%);
}

/* 角色头像样式改进 */
.character-card img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 20px;
    object-fit: cover;
    border: 4px solid rgba(102, 126, 234, 0.1);
    transition: var(--transition);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.character-card:hover img {
    border-color: rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

/* 角色名称样式 */
.character-card h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* 角色描述样式 */
.character-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 14px;
}

/* 角色标签样式 */
.character-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 15px 0;
}

.character-tag {
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    color: #667eea;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* 角色类型指示器 */
.character-type {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success-color);
}

.character-type.premium {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
}

.character-type.new {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
}

/* 对话界面 */
.chat-interface {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.character-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.character-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.character-details h3 {
    color: #333;
    margin-bottom: 5px;
}

.character-details p {
    color: #666;
    font-size: 14px;
}

.chat-controls {
    display: flex;
    gap: 10px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 20px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.message.ai {
    background: #f5f5f5;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    border: 1px solid #e0e0e0;
}

.message .timestamp {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 5px;
}

.chat-input {
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.input-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-controls input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-controls input:focus {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.voice-status {
    margin-top: 10px;
    padding: 10px;
    background: #ffe0e0;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-indicator {
    color: #d32f2f;
    font-weight: 500;
}

/* 技能面板 */
.skills-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.skills-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.skill-card {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.skill-card:hover {
    background: white;
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.skill-card h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.skill-card p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* 游戏界面 */
.game-interface {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.game-types {
    text-align: center;
    margin-bottom: 25px;
}

.game-area {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    min-height: 200px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.game-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.game-input input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    font-size: 16px;
    transition: all 0.3s ease;
}

.game-input input:focus {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误提示 */
.error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff5252;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 350px;
}

.error-toast button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .main-content {
        padding: 20px;
    }

    .character-grid {
        grid-template-columns: 1fr;
    }

    .chat-interface {
        height: 500px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .message {
        max-width: 90%;
    }

    .input-controls {
        flex-wrap: wrap;
    }

    .btn-voice {
        order: -1;
        margin-bottom: 10px;
    }
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 角色卡片动作按钮 */
.character-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    align-items: center;
}

.character-actions .select-btn {
    flex: 1;
    max-width: 120px;
}

.character-actions .favorite-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid #e0e0e0;
    transition: var(--transition);
}

.character-actions .favorite-btn:hover {
    border-color: #ff6b6b;
    background: #fff5f5;
    transform: scale(1.1);
}

.character-actions .favorite-btn.active {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    border-color: transparent;
    color: white;
}

/* 在线状态指示器 */
.online-status {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
}

.online-status.online .status-dot {
    background: var(--success-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.online-status.offline .status-dot {
    background: #ccc;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

/* 登录按钮激活状态 */
.btn.logged-in {
    background: linear-gradient(45deg, var(--success-color), #66bb6a);
    color: white;
    pointer-events: none;
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    .character-controls {
        padding: 20px 15px;
    }

    .character-stats {
        gap: 20px;
        padding: 15px;
    }

    .filter-buttons {
        justify-content: center;
    }

    .filter-btn,
    .personality-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .character-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 5px;
    }

    .character-card {
        padding: 20px 15px;
    }

    .character-card img {
        width: 70px;
        height: 70px;
    }

    .character-actions {
        flex-direction: column;
        gap: 8px;
    }

    .character-actions .select-btn {
        max-width: none;
        width: 100%;
    }
}

/* 动画效果增强 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.slide-in {
    animation: slideInRight 0.3s ease-out;
}

.slide-out {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* 成功提示动画 */
.success-toast {
    animation: slideInRight 0.3s ease-out;
}

/* 自定义滚动条增强 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* 加载动画增强 */
.loading {
    backdrop-filter: blur(10px);
}

.loading p {
    margin-top: 20px;
    font-size: 16px;
    color: white;
    text-align: center;
}

/* 新增：页面加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 新增：浮动通知系统 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 350px;
}

.notification {
    background: var(--background-white);
    backdrop-filter: var(--backdrop-blur);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-medium);
    border-left: 4px solid var(--success-color);
    animation: slideInRight 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.notification.error {
    border-left-color: var(--error-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

.notification.info {
    border-left-color: var(--info-color);
}

/* 新增：聊天气泡动画增强 */
.message {
    position: relative;
    margin-bottom: 16px;
    opacity: 0;
    animation: messageSlideIn 0.4s ease-out forwards;
}

.message.ai::before {
    content: '🤖';
    position: absolute;
    left: -35px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.8;
}

.message.user::after {
    content: '👤';
    position: absolute;
    right: -35px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.8;
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 新增：技能卡片特效 */
.skill-card {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.skill-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.5s ease;
}

.skill-card:hover::after {
    left: 100%;
}

/* 新增：悬浮按钮效果 */
.floating-action-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    z-index: 1000;
}

.floating-action-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-heavy);
}

/* 新增：角色卡片特殊状态 */
.character-card.premium::after {
    content: '👑';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 18px;
    opacity: 0.8;
}

.character-card.new::after {
    content: '🆕';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 16px;
}

.character-card.offline {
    opacity: 0.7;
    filter: grayscale(30%);
}

.character-card.offline::before {
    opacity: 0;
}

/* 新增：聊天界面增强 */
.chat-messages {
    position: relative;
    padding-right: 50px;
    padding-left: 50px;
}

/* 新增：输入框增强效果 */
.chat-input input,
.search-box input {
    position: relative;
}

.chat-input input:focus,
.search-box input:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-gradient);
}

/* 新增：加载状态增强 */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

/* 新增：3D 变换效果 */
@media (min-width: 1024px) {
    .character-card {
        transform-style: preserve-3d;
        perspective: 1000px;
    }

    .character-card:hover {
        transform: translateY(-10px) rotateX(5deg) rotateY(-2deg) scale(1.02);
    }

    .header {
        transform-style: preserve-3d;
    }

    .header:hover {
        transform: translateY(-2px);
    }
}